package com.study.hot.di.dagger.dagger2.module;


import com.study.hot.di.dagger.dagger2.model.Soul;
import com.study.hot.di.dagger.dagger2.model.Women;

/**
 * <pre>
 *     author : slx
 *     time   : 2020/11/25
 *     desc   : module传参
 * </pre>
 */
//@Module
public class WomenModule {
    //添加了一个参数money(或者Context)，在构造方法中传参改动比较大，可以使用 @BindsInstance 直接传参
    /*private int money;

    public WomenModule(int money) {
        this.money = money;
    }*/

    //@Provides
    Soul provideSoul(int money) {
        Soul soul = new Soul(1);
        soul.setMoney(money);
        return soul;
    }

    //@Provides
    Women provideWomen(Soul soul) {
        Women women = new Women();
        women.setSoul(soul);
        return women;
    }
}
